<template>
  <f7-page>
    <f7-navbar title="流程历史" back-link=""></f7-navbar>
    <f7-list media-list>
      <f7-list-item v-for="(item) in datas" v-bind:key="item.id"
                    v-bind:title="item.activityName"
                    v-bind:after="item.result"
                    v-bind:subtitle="item.startTime + ' -- ' + item.endTime"
                    v-bind:text="item.assignee"></f7-list-item>
    </f7-list>
  </f7-page>
</template>
<script>

export default {
  data () {
    return {
      datas: []
    }
  },
  created () {
    this.$f7ready((f7) => {
      let that = this;
      let id = this.$f7route.params.id;
      f7.request.setup({
        headers: {
          'AccessToken': sessionStorage.getItem('accessToken'),
          'JSESSIONID': sessionStorage.getItem('userToken')
        }
      });
      if (id !== undefined) {
        let that = this;
        f7.request.json(that.GLOBAL.RequestAddress + '/camel/rest/workflow/activities', {
          'historyProcessId': id,
          'page': 1,
          'limit': 10,
          'jsonStr': ''
        }, function (result) {
          if (result.success === undefined) {
            that.datas = result.data;
          }
        });
      }
    });
  }
}
</script>
